Hot standby method, apparatus, and system

ABSTRACT

Embodiments of the present disclosure provide a hot standby method, apparatus, and system. The method includes: saving, by an active device, first user information of the active device into a local cache module of the active device and sending, by the active device, the first user information to a remote cache module of a first standby device based on preset correlation information. In response to detecting that the active device becomes faulty, the first standby device obtains the first user information from the remote cache module of the first standby device and restores the first user information.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/934,382, filed on Mar. 23, 2018, which is a continuation ofInternational Application No. PCT/CN2016/099732, filed on Sep. 22, 2016.The International Application claims priority to Chinese PatentApplication No. 201510618629.7, filed on Sep. 24, 2015. The disclosuresof the aforementioned applications are hereby incorporated by referencein their entireties. All of the aforementioned patent applications arehereby incorporated by reference in their entireties.

TECHNICAL FIELD

Embodiments of the present disclosure relate to Internet technologies,and in particular, to a hot standby method, apparatus, and system.

BACKGROUND

In current network application, to avoid a risk of network interruptioncaused due to a single point of failure, dual-host hot standby betweendevices should be supported for a service node at an aggregation layeror an edge layer.

In an existing dual-host hot standby method, an active device and astandby device form a hot standby group. When a user accesses the activedevice, the active device saves user information corresponding to theuser into an external database shared with the standby device, so thatwhen the active device becomes faulty, the standby device reads the userinformation from the external database and restores the user informationof the user.

However, in the dual-host hot standby method in the prior art, there isa relatively large delay in restoring the user information of the user.Consequently, a communications device fault protection requirementrequired for hot standby cannot be met, and service interruption mayoccur.

SUMMARY

Embodiments of the present disclosure provide a hot standby method,apparatus, and system, so that a multi-host hot standby function isimplemented, and user information of a faulty device may be quicklyrestored, thereby improving restoration efficiency.

According to a first aspect, an embodiment of the present disclosureprovides a hot standby method, where the method is applied to a hotstandby system; the hot standby system includes at least one hot standbygroup; the hot standby group includes: an active device and at least onestandby device corresponding to the active device; and the methodincludes:

saving, by the active device, first user information of the activedevice into a local cache module of the active device, where the localcache module of the active device is configured to store userinformation of the active device; and

sending, by the active device, the first user information to a remotecache module of a first standby device based on preset correlationinformation, so that when detecting that the active device becomesfaulty, the first standby device obtains the first user information fromthe remote cache module of the first standby device and restores thefirst user information, where the first standby device is a device inthe at least one standby device, and the remote cache module of thefirst standby device is configured to store the user information of theactive device, where

the preset correlation information includes: an active-standbyrelationship between the active device and the first standby device anda first priority of the first standby device, where the first priorityindicates a priority level of restoring the user information of theactive device by the first standby device.

With reference to the first aspect, in a first possible implementationof the first aspect, the hot standby group is a multi-host hot standbygroup; and correspondingly, the active device is an active broadbandnetwork gateway (BNG), and the first standby device is a first standbyBNG; or

the hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

With reference to the first aspect or the first possible implementationof the first aspect, in a second possible implementation of the firstaspect, the method further includes:

saving, by the active device, second user information of the activedevice into the local cache module of the active device; and

correspondingly, sending, by the active device, the second userinformation of the active device to a remote cache module of a secondstandby device based on the preset correlation information, so that whendetecting that the active device becomes faulty, the second standbydevice obtains the second user information from the remote cache moduleof the second standby device and restores the second user information,where the second standby device is a device in the at least one standbydevice, and the remote cache module of the second standby device isconfigured to store the user information of the active device, where

the preset correlation information further includes: an active-standbyrelationship between the active device and the second standby device, asecond priority of the second standby device, and a load balancingrelationship between the first standby device and the second standbydevice, where the second priority indicates a priority level ofrestoring the user information of the active device by the secondstandby device; the first priority is the same as the second priority;and the load balancing relationship is used to indicate that when theactive device becomes faulty, the first standby device is configured tobe responsible for restoring the first user information, and the secondstandby device is configured to be responsible for restoring the seconduser information.

With reference to the second possible implementation of the firstaspect, in a third possible implementation of the first aspect, thefirst user information is information corresponding to a user whoaccesses by using a first interface of the active device, and the seconduser information is information corresponding to a user who accesses byusing a second interface of the active device, where the first interfaceis different from the second interface.

With reference to the first aspect or the first possible implementationof the first aspect, in a fourth possible implementation of the firstaspect, the method further includes:

sending, by the active device, the first user information to a remotecache module of a third standby device based on the preset correlationinformation, where the third standby device is a device in the at leastone standby device, where

the preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

With reference to the second or the third possible implementation of thefirst aspect, in a fifth possible implementation of the first aspect,the method further includes:

sending, by the active device, the first user information and the seconduser information to a remote cache module of a third standby devicebased on the preset correlation information, where the third standbydevice is a device in the at least one standby device, where

the preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

With reference to the first aspect, or the first or the fourth possibleimplementation of the first aspect, in a sixth possible implementationof the first aspect, after the saving, by the active device, first userinformation of the active device into a local cache module of the activedevice, the method further includes:

saving, by the active device, the first user information into anexternal database shared with the at least one standby device.

With reference to the second, the third, or the fifth possibleimplementation of the first aspect, in a seventh possible implementationof the first aspect, after the saving, by the active device, second userinformation of the active device into the local cache module of theactive device, the method further includes:

saving, by the active device, the first user information and the seconduser information into an external database shared with the at least onestandby device.

With reference to any one of the first aspect, or the first to theseventh possible implementations of the first aspect, in an eighthpossible implementation of the first aspect, before the saving, by theactive device, first user information of the active device into a localcache module of the active device, the method further includes:

obtaining, by the active device, the preset correlation information.

According to a second aspect, an embodiment of the present discloseprovides a hot standby method, where the method is applied to a hotstandby system; the hot standby system includes at least one hot standbygroup; the hot standby group includes: an active device and at least onestandby device corresponding to the active device; the at least onestandby device includes a first standby device with a first priority;the first priority indicates a priority level of restoring userinformation of the active device by the first standby device; and themethod includes:

receiving, by the first standby device, first user information sent bythe active device, and saving the first user information into a remotecache module of the first standby device, where the remote cache moduleof the first standby device is configured to store the user informationof the active device; and

when detecting that the active device becomes faulty, obtaining, by thefirst standby device, the first user information from the remote cachemodule and restoring the first user information.

With reference to the second aspect, in a first possible implementationof the second aspect, the hot standby group is a multi-host hot standbygroup; and

correspondingly, the active device is an active broadband networkgateway (BNG), and the first standby device is a first standby BNG; or

the hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

With reference to the second aspect or the first possible implementationof the second aspect, in a second possible implementation of the secondaspect, after the saving the first user information into a remote cachemodule of the first standby device, the method further includes:

establishing, by the first standby device, an index based on identityinformation of the active device; and

correspondingly, the obtaining, by the first standby device, the firstuser information from the remote cache module and restoring the firstuser information includes:

directly obtaining, by the first standby device, the first userinformation from the remote cache module based on the index andrestoring the first user information.

With reference to the first possible implementation of the secondaspect, in a third possible implementation of the second aspect, whenthe hot standby group is the multi-service control module hot standbygroup of the virtual BNG, correspondingly, when the active device is theactive service control module of the virtual BNG, and the first standbydevice is the first standby service control module of the virtual BNG,after the obtaining, by the first standby device, the first userinformation from the remote cache module and restoring the first userinformation, the method further includes:

sending, by the first standby service control module, a notificationinstruction to a service forwarding module, where the notificationinstruction is used to instruct the service forwarding module to send auser management message of a user corresponding to the first userinformation to the first standby service control module.

According to a third aspect, an embodiment of the present disclosureprovides an active device, where the active device belongs to a hotstandby system; the hot standby system includes at least one hot standbygroup; the hot standby group includes: the active device and at leastone standby device corresponding to the active device; and the activedevice includes:

a first storage module, configured to save first user information of theactive device into a local cache module of the active device, where thelocal cache module of the active device is configured to store userinformation of the active device; and

a first sending module, configured to send the first user information toa remote cache module of a first standby device based on presetcorrelation information, so that when detecting that the active devicebecomes faulty, the first standby device obtains the first userinformation from the remote cache module of the first standby device andrestores the first user information, where the first standby device is adevice in the at least one standby device, and the remote cache moduleof the first standby device is configured to store the user informationof the active device, where

the preset correlation information includes: an active-standbyrelationship between the active device and the first standby device anda first priority of the first standby device, where the first priorityindicates a priority level of restoring the user information of theactive device by the first standby device.

With reference to the third aspect, in a first possible implementationof the third aspect, the hot standby group is a multi-host hot standbygroup; and correspondingly, the active device is an active broadbandnetwork gateway (BNG), and the first standby device is a first standbyBNG; or

the hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

With reference to the third aspect or the first possible implementationof the third aspect, in a second possible implementation of the thirdaspect, the active device further includes:

a second storage module, configured to save second user information ofthe active device into the local cache module of the active device; and

a second sending module, configured to send the second user informationof the active device to a remote cache module of a second standby devicebased on the preset correlation information, so that when detecting thatthe active device becomes faulty, the second standby device obtains thesecond user information from the remote cache module of the secondstandby device and restores the second user information, where thesecond standby device is a device in the at least one standby device,and the remote cache module of the second standby device is configuredto store the user information of the active device, where

the preset correlation information further includes: an active-standbyrelationship between the active device and the second standby device, asecond priority of the second standby device, and a load balancingrelationship between the first standby device and the second standbydevice, where the second priority indicates a priority level ofrestoring the user information of the active device by the secondstandby device; the first priority is the same as the second priority;and the load balancing relationship is used to indicate that when theactive device becomes faulty, the first standby device is configured tobe responsible for restoring the first user information, and the secondstandby device is configured to be responsible for restoring the seconduser information.

With reference to the second possible implementation of the thirdaspect, in a third possible implementation of the third aspect, thefirst user information is information corresponding to a user whoaccesses by using a first interface of the active device, and the seconduser information is information corresponding to a user who accesses byusing a second interface of the active device, where the first interfaceis different from the second interface.

With reference to the third aspect or the first possible implementationof the third aspect, in a fourth possible implementation of the thirdaspect, the active device further includes:

a third sending module, configured to send the first user information toa remote cache module of a third standby device based on the presetcorrelation information, where the third standby device is a device inthe at least one standby device, where

the preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

With reference to the second or the third possible implementation of thethird aspect, in a fifth possible implementation of the third aspect,the active device further includes:

a fourth sending module, configured to send the first user informationand the second user information to a remote cache module of a thirdstandby device based on the preset correlation information, where thethird standby device is a device in the at least one standby device,where

the preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

With reference to the third aspect, or the first or the fourth possibleimplementation of the third aspect, in a sixth possible implementationof the third aspect, the active device further includes:

a third storage module, configured to save the first user informationinto an external database shared with the at least one standby device.

With reference to the second, the third, or the fifth possibleimplementation of the third aspect, in a seventh possible implementationof the third aspect, the active device further includes:

a fourth storage module, configured to save the first user informationand the second user information into an external database shared withthe at least one standby device.

According to a fourth aspect, an embodiment of the present disclosureprovides a first standby device, where the first standby device belongsto a hot standby system; the hot standby system includes at least onehot standby group; the hot standby group includes: an active device andat least one standby device corresponding to the active device; the atleast one standby device includes the first standby device with a firstpriority; the first priority indicates a priority level of restoringuser information of the active device by the first standby device; andthe first standby device includes:

a storage module, configured to: receive first user information sent bythe active device, and save the first user information into a remotecache module of the first standby device, where the remote cache moduleof the first standby device is configured to store the user informationof the active device; and

a restoration module, configured to: when detecting that the activedevice becomes faulty, obtain the first user information from the remotecache module and restore the first user information.

With reference to the fourth aspect, in a first possible implementationof the fourth aspect, the hot standby group is a multi-host hot standbygroup; and correspondingly, the active device is an active broadbandnetwork gateway (BNG), and the first standby device is a first standbyBNG; or

the hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

With reference to the fourth aspect or the first possible implementationof the fourth aspect, in a second possible implementation of the fourthaspect, the first standby device further includes:

an establishment module, configured to establish an index based onidentity information of the active device; and

correspondingly, the restoration module is configured to: directlyobtain the first user information from the remote cache module based onthe index and restore the first user information.

With reference to the first possible implementation of the fourthaspect, in a third possible implementation of the fourth aspect, whenthe hot standby group is the multi-service control module hot standbygroup of the virtual BNG, correspondingly, when the active device is theactive service control module of the virtual BNG, and the first standbydevice is the first standby service control module of the virtual BNG,the first standby device further includes:

a notification module, configured to send a notification instruction toa service forwarding module, where the notification instruction is usedto instruct the service forwarding module to send a user managementmessage of a user corresponding to the first user information to thefirst standby service control module.

According to a fifth aspect, an embodiment of the present disclosureprovides a hot standby system. The hot standby system includes at leastone hot standby group, and the hot standby includes: the active devicein any implementation of the third aspect and at least one standbydevice corresponding to the active device. The at least one standbydevice includes the first standby device in any implementation of thefourth aspect.

In one embodiment of the present disclosure, the active device saves thefirst user information of the active device into the local cache moduleof the active device; further, the active device sends the first userinformation to the remote cache module of the first standby device basedon the preset correlation information, so that when detecting that theactive device becomes faulty, the first standby device directly obtainsthe first user information from the remote cache module of the firststandby device and restores the first user information. It may belearned that in the embodiments of the present disclosure, a multi-hosthot standby function may be implemented, and user information of afaulty device may be quickly restored, thereby improving restorationefficiency.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure more clearly, the following briefly describes theaccompanying drawings required for describing the embodiments or theprior art. Apparently, the accompanying drawings in the followingdescription show some embodiments of the present disclosure, and personsof ordinary skill in the art may still derive other drawings from theseaccompanying drawings without creative efforts.

FIG. 1 is a schematic flowchart of Embodiment 1 of a hot standby methodaccording to the present disclosure.

FIG. 2 is a schematic flowchart of Embodiment 2 of a hot standby methodaccording to the present disclosure.

FIG. 3A is a schematic flowchart of Embodiment 3 of a hot standby methodaccording to the present disclosure.

FIG. 3B is a schematic structural diagram of Embodiment 1 of a hotstandby system according to the present disclosure.

FIG. 4A is a schematic flowchart of Embodiment 4 of a hot standby methodaccording to the present disclosure.

FIG. 4B is a schematic structural diagram of Embodiment 2 of a hotstandby system according to the present disclosure.

FIG. 5 is a schematic structural diagram of Embodiment 1 of an activedevice according to the present disclosure.

FIG. 6 is a schematic structural diagram of Embodiment 2 of an activedevice according to the present disclosure.

FIG. 7 is a schematic structural diagram of Embodiment 1 of a firststandby device according to the present disclosure.

FIG. 8 is a schematic structural diagram of Embodiment 2 of a firststandby device according to the present disclosure.

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of theembodiments of the present disclosure clearer, the following clearlydescribes the technical solutions in the embodiments of the presentdisclosure with reference to the accompanying drawings in theembodiments of the present disclosure. Apparently, the describedembodiments are some but not all of the embodiments of the presentdisclosure. All other embodiments obtained by persons of ordinary skillin the art based on the embodiments of the present disclosure withoutcreative efforts shall fall within the protection scope of the presentdisclosure.

FIG. 1 is a schematic flowchart of Embodiment 1 of a hot standby methodaccording to the present disclosure. The method in this embodiment isapplied to a hot standby system. The hot standby system includes atleast one hot standby group, and the hot standby group includes: anactive device and at least one standby device corresponding to theactive device. As shown in FIG. 1, the method in this embodiment mayinclude the following steps.

S101. The active device saves first user information of the activedevice into a local cache module of the active device.

In this embodiment of the present disclosure, a local cache module and aremote cache module are added to both the active device and the standbydevice in this embodiment of the present disclosure, to reduce a servicerestoration time consumed when the active device becomes faulty. Thelocal cache module is configured to store user information of a localdevice (for example, the local cache module of the active device isconfigured to store user information of the active device, and a localcache module of the standby device is configured to store userinformation of the standby device). The remote cache module isconfigured to store user information of another device that belongs to asame hot standby group as the local device and whose priority is higherthan that of the local device (for example, a hot standby group 1includes: a device 1, a device 2, and a device 3; a priority of thedevice 1 is higher than a priority of the device 2, and the priority ofthe device 2 is higher than a priority of the device 3; and a remotecache module of the device 2 is configured to store user information ofthe device 1, and a remote cache module of the device 3 is configured tostore the user information of the device 1 and user information of thedevice 2). Optionally, the local cache module of the active deviceand/or the standby device may be a local cache data module. The remotecache module of the active device and/or the standby device may be aremote cache data module. Optionally, a memory address of the localcache module of the active device and/or the standby device is differentfrom a memory address of the remote cache module of the active deviceand/or the standby device.

In this embodiment of the present disclosure, when a useraccesses/disconnects from the active device, or statistics of the usershould be updated, the active device saves the first user information ofthe active device into the local cache module of the active device.Optionally, the first user information may be user informationcorresponding to all online/offline users of the active device, or userinformation corresponding to some online/offline users of the activedevice (for example, information corresponding to a user who accesses byusing a first interface of the active device). The first userinformation may include information such as a user identity (ID), aMedia Access Control (MAC) address of a user, an Internet Protocol (IP)address of a user, physical location information of a user, an accessprotocol attribute of a user, session group information, and trafficstatistics.

S102. The active device sends the first user information to a remotecache module of a first standby device based on preset correlationinformation, so that when detecting that the active device becomesfaulty, the first standby device obtains the first user information fromthe remote cache module of the first standby device and restores thefirst user information.

The first standby device is a device in the at least one standby device.The remote cache module of the first standby device is configured tostore the user information of the active device. The preset correlation(correlation) information includes: an active-standby relationshipbetween the active device and the first standby device and a firstpriority of the first standby device, where the first priority indicatesa priority level of restoring the user information of the active deviceby the first standby device.

In this embodiment of the present disclosure, the active device sendsthe first user information to the remote cache module of the firststandby device based on the preset correlation information, so that whendetecting that the active device becomes faulty, the first standbydevice directly obtains the first user information from the remote cachemodule of the first standby device and restores the first userinformation, with no need to read the first user information from anexternal database to restore the first user information. The firststandby device is a device with a highest priority in the at least onestandby device (the first standby device has the first priority).Because a remote cache module of any standby device is configured tostore user information of another device that belongs to a same hotstandby group as the local device and whose priority is higher than thatof the local device, the remote cache module of the first standby deviceis configured to store the user information of the active device (thatis, there is only the active device whose priority is higher than thatof the first standby device in the hot standby group). The presetcorrelation information includes: the active-standby relationshipbetween the active device and the first standby device and the firstpriority of the first standby device. The first priority indicates thepriority level of restoring the user information of the active device bythe first standby device (optionally, the first standby device is astandby device with a highest priority in the at least one standbydevice; or the active device in the hot standby group has a highestpriority, the at least one standby device has descending priorities, andthe first standby device is a standby device with a highest priority inthe at least one standby device).

In this embodiment of the present disclosure, step S101 may be performedbefore step S102, step S102 may be performed before step S101, or stepS101 and step S102 may be concurrently performed. An execution sequenceof step S101 and step S102 is not limited in this embodiment of thepresent disclosure.

In this embodiment of the present disclosure, the active device savesthe first user information of the active device into the local cachemodule of the active device; further, the active device sends the firstuser information to the remote cache module of the first standby devicebased on the preset correlation information, so that when detecting thatthe active device becomes faulty, the first standby device directlyobtains the first user information from the remote cache module of thefirst standby device and restores the first user information. It may belearned that in this embodiment of the present disclosure, a multi-hosthot standby function may be implemented, and user information of afaulty device may be quickly restored, thereby improving restorationefficiency.

Optionally, the method further includes:

sending, by the active device, the first user information to a remotecache module of a third standby device based on the preset correlationinformation, where the third standby device is a device in the at leastone standby device.

The preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

In this embodiment of the present disclosure, the active device mayfurther send the first user information to the remote cache module ofthe third standby device based on the preset correlation information(including the active-standby relationship between the active device andthe first standby device, the active-standby relationship between theactive device and the third standby device, the first priority of thefirst standby device, and the third priority of the third standbydevice), where the third standby device is another device other than thefirst standby device in the at least one standby device, and thepriority of the third standby device is lower than the priority of thefirst standby device (that is, the third priority is lower than thefirst priority), so that when the first standby device also becomesfaulty, a standby device with a highest priority in the third standbydevice obtains the first user information from a remote cache module ofthe standby device and quickly restores the first user information.Certainly, an execution sequence of the step in which the active devicesends the first user information to the remote cache module of the firststandby device and the step in which the active device sends the firstuser information to the remote cache module of the third standby deviceis not limited in this embodiment of the present disclosure.

Optionally, after step S101, the method further includes: saving, by theactive device, the first user information into an external databaseshared with the at least one standby device.

To avoid a problem that the first user information cannot be restoredbecause an error occurs (the first user information is not saved) in theremote cache module of the first standby device, in this embodiment ofthe present disclosure, after step S101, the active device may furthersave the first user information into the external database shared withthe at least one standby device, so that when the first user informationis not found in the remote cache module of the first standby device, thefirst standby device may obtain the first user information from theexternal database, so as to restore the first user information.

Optionally, the method further includes:

saving, by the active device, second user information of the activedevice into the local cache module of the active device; and

correspondingly, sending, by the active device, the second userinformation of the active device to a remote cache module of a secondstandby device based on the preset correlation information, so that whendetecting that the active device becomes faulty, the second standbydevice obtains the second user information from the remote cache moduleof the second standby device and restores the second user information,where the second standby device is a device in the at least one standbydevice, and the remote cache module of the second standby device isconfigured to store the user information of the active device.

The preset correlation information further includes: an active-standbyrelationship between the active device and the second standby device, asecond priority of the second standby device, and a load balancingrelationship between the first standby device and the second standbydevice, where the second priority indicates a priority level ofrestoring the user information of the active device by the secondstandby device; the first priority is the same as the second priority;and the load balancing relationship is used to indicate that when theactive device becomes faulty, the first standby device is configured tobe responsible for restoring the first user information, and the secondstandby device is configured to be responsible for restoring the seconduser information.

In this embodiment of the present disclosure, if the standby device witha highest priority in the at least one standby device includes the firststandby device and the second standby device, the preset correlationinformation further includes: the active-standby relationship betweenthe active device and the second standby device, the second priority ofthe second standby device (the second priority indicates the prioritylevel of restoring the user information of the active device by thesecond standby device, and the first priority is the same as the secondpriority), and the load balancing relationship between the first standbydevice and the second standby device (used to indicate that when theactive device becomes faulty, the first standby device is configured tobe responsible for restoring the first user information, and the secondstandby device is configured to be responsible for restoring the seconduser information). Optionally, the load balancing relationship isdivided based on an interface used by a user of the active device toaccess the active device. For example, the first standby device isconfigured to be responsible for restoring information (that is, thefirst user information) corresponding to a user who accesses by usingthe first interface of the active device, and the second standby deviceis configured to be responsible for restoring information (that is, thesecond user information) corresponding to a user who accesses by using asecond interface of the active device. The first interface is differentfrom the second interface. For example, the standby device with ahighest priority in the at least one standby device includes a standbydevice A (that is, the first standby device) and a standby device B(that is, the second standby device), and the load balancingrelationship is used to indicate that the standby device A is configuredto be responsible for restoring the first user information correspondingto a user who accesses by using the first interface of the activedevice, and the standby device B is configured to be responsible forrestoring the second user information corresponding to a user whoaccesses by using the second interface of the active device.

In this embodiment of the present disclosure, if the standby device witha highest priority in the at least one standby device includes the firststandby device and the second standby device, the active device savesthe first user information (optionally, the first user information isthe information corresponding to a user who accesses by using the firstinterface of the active device) of the active device into the localcache module of the active device, and the active device sends the firstuser information to the remote cache module of the first standby devicebased on the preset correlation information (including theactive-standby relationship between the active device and the firststandby device, the active-standby relationship between the activedevice and the second standby device, the first priority of the firststandby device, the second priority of the second standby device, andthe load balancing relationship between the first standby device and thesecond standby device). In addition, the active device saves the seconduser information (the information corresponding to a user who accessesby using the second interface of the active device) of the active deviceinto the local cache module of the active device, and the active devicesends the second user information of the active device to the remotecache module of the second standby device based on the presetcorrelation information, so that when detecting that the active devicebecomes faulty, the second standby device obtains the second userinformation from the remote cache module of the second standby deviceand restores the second user information. Certainly, a sequence ofsaving the first user information and the second user information by theactive device is not limited in this embodiment of the presentdisclosure (that is, the first user information may be saved before thesecond user information, the second user information may be saved beforethe first user information, or the first user information and the seconduser information may be saved at the same time).

Optionally, the method further includes:

sending, by the active device, the first user information and the seconduser information to a remote cache module of a third standby devicebased on the preset correlation information, where the third standbydevice is a device in the at least one standby device.

The preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

In this embodiment of the present disclosure, the active device mayfurther send the first user information and the second user informationto the remote cache module of the third standby device based on thepreset correlation information (including the active-standbyrelationship between the active device and the first standby device, theactive-standby relationship between the active device and the secondstandby device, the active-standby relationship between the activedevice and the third standby device, the first priority of the firststandby device, the second priority of the second standby device, andthe third priority of the third standby device), where the third standbydevice is another device other than the first standby device and thesecond standby device in the at least one standby device, and thepriority of the third standby device is lower than the priority of thefirst standby device and/or the second standby device (that is, thethird priority is lower than the first priority and/or the secondpriority), so that when the first standby device and/or the secondstandby device also become/becomes faulty, a standby device with ahighest priority in the third standby device obtains the first userinformation and/or the second user information from a remote cachemodule of the standby device and quickly performs a restoration.Certainly, an execution sequence of the step in which the active devicesends the first user information to the remote cache module of the firststandby device, the step in which the active device sends the seconduser information to the remote cache module of the second standbydevice, and the step in which the active device sends the first userinformation and the second user information to the remote cache moduleof the third standby device is not limited in this embodiment of thepresent disclosure.

Optionally, after the saving, by the active device, second userinformation of the active device into the local cache module of theactive device, the method further includes: saving, by the activedevice, the first user information and the second user information intoan external database shared with the at least one standby device.

To avoid a problem that the first user information and/or the seconduser information cannot be restored because an error occurs in theremote cache module of the first standby device and/or the remote cachemodule of the second standby device (the first user information is notsaved into the remote cache module of the first standby device and/orthe second user information is not saved into the remote cache module ofthe second standby device), in this embodiment of the presentdisclosure, after the active device saves the second user information ofthe active device into the local cache module of the active device, theactive device saves the first user information and the second userinformation into the external database shared with the at least onestandby device, so that when the first user information is not found inthe remote cache module of the first standby device and/or the seconduser information is not found in the remote cache module of the secondstandby device, the first standby device and/or the second standbydevice may obtain corresponding user information from the externaldatabase, so as to restore the user information.

Optionally, before step S101, the method further includes: obtaining, bythe active device, the preset correlation information.

In this embodiment of the present disclosure, optionally, before aservice is started, the preset correlation information may bepre-configured for the active device and the standby device. Optionally,the preset correlation information includes: an active-standbyrelationship between the active device and the at least one standbydevice, and priorities of the active device and the at least one standbydevice. Optionally, an active-standby relationship between multipledevices in a same hot standby group is determined based on priorities,and a device with a high priority (the active device) backs up userinformation to a device with a priority lower than and neighboring tothe high priority (the first standby device). When the active devicebecomes faulty, the first standby device starts restoration of the userinformation of the active device. Optionally, a device with a highpriority periodically sends heartbeat information to a device with a lowpriority, so that the device with a low priority detects, in real time,whether the device with a high priority becomes faulty (if no heartinformation of the device with a high priority is received within apreset time period, it may be learned that the device with a highpriority becomes faulty). Optionally, when there are multiple deviceswith a second-highest priority (the first standby device and the secondstandby device), a load balancing relationship between the multipledevices with a second-highest priority may be specified. The loadbalancing relationship is used to indicate that when the device with ahighest priority (that is, the active device) becomes faulty, themultiple devices with a second-highest priority are separatelyresponsible for restoring which users of the device with a highestpriority, so as to ensure response consistency of the devices with asecond-highest priority (for example, the first standby device isconfigured to be responsible for restoring the first user informationcorresponding to a user who accesses by using the first interface of theactive device, and the second standby device is configured to beresponsible for restoring the second user information corresponding to auser who accesses by using the second interface of the active device)when the device with a highest priority becomes faulty. Optionally,division of the load balancing relationship may be based on an interfaceused by a user to access the active device, or based on a MAC address,or the like. This is not limited in this embodiment of the presentdisclosure.

Optionally, to improve utilization of each device, optionally, devicemembers between different hot standby groups may be repeated in thisembodiment of the present disclosure. Active-standby functions inmultiple hot standby groups are distributed to different devices bysetting priorities of devices in different hot standby groups, so thatthe devices may work at the same time. For example, an active device ina hot standby group 1 is a device 1 (the device 1 has a highest priorityin the hot standby group 1). A standby device corresponding to thedevice 1 is a device 2, but the device 2 is an active device in a hotstandby group 2 (the device 2 has a highest priority in the hot standbygroup 2). A standby device corresponding to the device 2 may be a device3. It may be learned that the device 1 and the device 2 are respectivelyused as active devices of two different hot standby groups and may workat the same time.

Optionally, the hot standby group in the foregoing embodiment of thepresent disclosure is a multi-host hot standby group; andcorrespondingly, the active device is an active broadband networkgateway (BNG), and the first standby device is a first standby BNG; orthe hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

In this embodiment of the present disclosure, when the hot standby groupis the multi-host hot standby group, the multi-host hot standby groupincludes: the active BNG and at least one standby BNG corresponding tothe active BNG The active device is the active BNG, and the firststandby device is the first standby BNG with a highest priority in theat least one standby BNG Correspondingly, for a detailed hot standbymethod, refer to the foregoing part of this embodiment of the presentdisclosure, and details are not described herein. Optionally, the BNGmay be a broadband remote access server (BRAS). Alternatively, when thehot standby group is the multi-service control module hot standby groupof the virtual BNG, the multi-service control module hot standby groupof the virtual BNG includes: the active service control module of thevirtual BNG and at least one standby service control modulecorresponding to the active service control module. The active device isthe active service control module of the virtual BNG, and the firststandby device is the first standby service control module that is ofthe virtual BNG and whose priority is the highest in the at least onestandby service control module. Correspondingly, for a detailed hotstandby method, refer to the foregoing part of this embodiment of thepresent disclosure, and details are not described herein.

FIG. 2 is a schematic flowchart of Embodiment 2 of a hot standby methodaccording to the present disclosure. The method in this embodiment isapplied to a hot standby system. The hot standby system includes atleast one hot standby group, and the hot standby group includes: anactive device and at least one standby device corresponding to theactive device. The at least one standby device includes a first standbydevice with a first priority. The first priority indicates a prioritylevel of restoring user information of the active device by the firststandby device. Based on the foregoing embodiment of the presentdisclosure, a standby device side is described in detail in thisembodiment. As shown in FIG. 2, the method in this embodiment mayinclude the following steps.

S201. The first standby device receives first user information sent bythe active device, and saves the first user information into a remotecache module of the first standby device.

The remote cache module of the first standby device is configured tostore the user information of the active device.

In this embodiment of the present disclosure, when a useraccesses/disconnects from the active device, or statistics of the usershould be updated, the first standby device receives the first userinformation sent by the active device based on pre-planned correlationinformation, and saves the first user information into the remote cachemodule of the first standby device (optionally, the remote cache moduleis configured to cache user information of another device that belongsto a same hot standby group as the first standby device and whosepriority is higher than that of the first standby device), so that whenthe active device becomes faulty, the first standby device may directlyobtain the first user information from the remote cache module of thefirst standby device and quickly restore the first user information.Optionally, the preset correlation information includes: anactive-standby relationship between the active device and the firststandby device and a first priority of the first standby device.Optionally, the first user information may be user informationcorresponding to all online/offline users of the active device, or userinformation corresponding to some online/offline users of the activedevice (for example, information corresponding to a user who accesses byusing a first interface of the active device). The first userinformation may include information such as a user ID, a MAC address ofa user, an IP address of a user, physical location information of auser, an access protocol attribute of a user, session group information,and traffic statistics.

S202. When detecting that the active device becomes faulty, the firststandby device obtains the first user information from the remote cachemodule and restores the first user information.

In this embodiment of the present disclosure, optionally, a device witha high priority (for example, the active device) periodically sendsheartbeat information to a device with a low priority (for example, thefirst standby device), so that the device with a low priority detects,in real time, whether the device with a high priority becomes faulty.When no heartbeat information sent by the active device is receivedwithin a preset time period, the first standby device detects that theactive device becomes faulty, and further the first standby devicedirectly obtains the first user information from the remote cache moduleof the first standby device and restores the first user information.Optionally, if a standby device with a highest priority in the at leastone standby device also becomes faulty, a standby device with asecond-highest priority in the at least one standby device obtains thefirst user information from a remote cache module of the standby deviceand quickly restores the first user information (that is, the standbydevice with a second-highest priority is a standby device with a highestpriority in standby devices that can normally work in the at least onestandby device, that is, the standby device with a second-highestpriority may also be referred to as a first standby device).

In this embodiment of the present disclosure, the first standby devicereceives the first user information sent by the active device, and savesthe first user information into the remote cache module of the firststandby device. Further, when detecting that the active device becomesfaulty, the first standby device directly obtains the first userinformation from the remote cache module and restores the first userinformation. It may be learned that in this embodiment of the presentdisclosure, a multi-host hot standby function may be implemented, anduser information of a faulty device may be quickly restored, therebyimproving restoration efficiency.

Optionally, after the saving the first user information into a remotecache module of the first standby device, the method further includes:

establishing, by the first standby device, an index based on identityinformation of the active device.

Correspondingly, the obtaining, by the first standby device, the firstuser information from the remote cache module and restoring the firstuser information includes:

directly obtaining, by the first standby device, the first userinformation from the remote cache module based on the index andrestoring the first user information.

To make the first standby device be able to read, in one time when theactive device becomes faulty, all the first user information stored inthe remote cache module of the first standby device by the activedevice, so as to reduce a restoration time, in this embodiment of thepresent disclosure, optionally, after saving the first user informationinto the remote cache module of the first standby device, the firststandby device establishes the index based on the identity informationof the active device. Further, when detecting that the active devicebecomes faulty, the first standby device may obtain the first userinformation from the remote cache module in one time based on the indexand restore the first user information, so as to improve restorationefficiency.

Optionally, before step S201, the method further includes: obtaining, bythe first standby device, the preset correlation information.

In this embodiment of the present disclosure, optionally, before aservice is started, the preset correlation information may bepre-configured for the active device and the standby device. Optionally,the preset correlation information includes: an active-standbyrelationship between the active device and the at least one standbydevice, and priorities of the active device and the at least one standbydevice. Optionally, an active-standby relationship between multipledevices in a same hot standby group is determined based on priorities,and a device with a high priority (the active device) backs up userinformation to a device with a priority lower than and neighboring tothe high priority (the first standby device). When the active devicebecomes faulty, the first standby device starts restoration of the userinformation of the active device. Optionally, a device with a highpriority periodically sends heartbeat information to a device with a lowpriority, so that the device with a low priority detects, in real time,whether the device with a high priority becomes faulty (if no heartinformation of the device with a high priority is received within apreset time period, it may be learned that the device with a highpriority becomes faulty). Optionally, when there are multiple deviceswith a second-highest priority (the first standby device and the secondstandby device), a load balancing relationship between the multipledevices with a second-highest priority may be specified. That is, theload balancing relationship is used to indicate that when the devicewith a highest priority (that is, the active device) becomes faulty, themultiple devices with a second-highest priority are separatelyresponsible for restoring which users of the device with a highestpriority, so as to ensure response consistency of the devices with asecond-highest priority (for example, the first standby device isconfigured to be responsible for restoring the first user informationcorresponding to a user who accesses by using the first interface of theactive device, and the second standby device is configured to beresponsible for restoring the second user information corresponding to auser who accesses by using the second interface of the active device)when the device with a highest priority becomes faulty. Optionally,division of the load balancing relationship may be based on an interfaceused by a user to access the active device, or based on a MAC address,or the like. This is not limited in this embodiment of the presentdisclosure.

Optionally, the hot standby group in the foregoing embodiment of thepresent disclosure is a multi-host hot standby group; andcorrespondingly, the active device is an active broadband networkgateway BNG, and the first standby device is a first standby BNG; or thehot standby group is a multi-service control module hot standby group ofa virtual BNG; and correspondingly, the active device is an activeservice control module of the virtual BNG, and the first standby deviceis a first standby service control module of the virtual BNG.

In this embodiment of the present disclosure, when the hot standby groupis the multi-host hot standby group, the multi-host hot standby groupincludes: the active BNG and at least one standby BNG corresponding tothe active BNG The active device is the active BNG, and the firststandby device is the first standby BNG with a highest priority in theat least one standby BNG Alternatively, when the hot standby group isthe multi-service control module hot standby group of the virtual BNG,the multi-service control module hot standby group of the virtual BNGincludes: the active service control module of the virtual BNG and atleast one standby service control module corresponding to the activeservice control module. The active device is the active service controlmodule of the virtual BNG, and the first standby device is the firststandby service control module that is of the virtual BNG and whosepriority is the highest in the at least one standby service controlmodule.

Optionally, when the hot standby group is the multi-service controlmodule hot standby group of the virtual BNG, correspondingly, when theactive device is the active service control module of the virtual BNG,and the first standby device is the first standby service control moduleof the virtual BNG, after the obtaining, by the first standby device,the first user information from the remote cache module and restoringthe first user information, the method further includes:

sending, by the first standby service control module, a notificationinstruction to a service forwarding module, where the notificationinstruction is used to instruct the service forwarding module to send auser management message of a user corresponding to the first userinformation to the first standby service control module.

In this embodiment of the present disclosure, when the hot standby groupis the multi-service control module hot standby group of the virtualBNG, because service forwarding and service control are implemented bydifferent modules, when the active service control module becomesfaulty, user information of the active service control module should behanded over to the first standby service control module. Therefore,after obtaining the first user information from the remote cache moduleof the first standby service control module and restoring the first userinformation, the first standby service control module sends thenotification instruction to the service forwarding module of the virtualBNG The notification instruction is used to instruct the serviceforwarding module to send a user management message of a usercorresponding to the first user information to the first standby servicecontrol module, with no need to send the user management message to theactive service control module. The first user information may be userinformation corresponding to multiple users, and the notificationinstruction is used to instruct the service forwarding module to send auser management message of each user corresponding to the first userinformation to the first standby service control module.

FIG. 3A is a schematic flowchart of Embodiment 3 of a hot standby methodaccording to the present disclosure. FIG. 3B is a schematic structuraldiagram of Embodiment 1 of a hot standby system according to the presentdisclosure. The method in this embodiment is applied to a hot standbysystem. The hot standby system includes at least one multi-host hotstandby group, and the multi-host hot standby group includes: an activeBNG and at least one standby BNG corresponding to the active BNG Thefirst standby BNG is a standby BNG with a highest priority in the atleast one standby BNG As shown in FIG. 3A, the method in this embodimentmay include the following steps.

S301. The active BNG saves user information of the active BNG into alocal cache module of the active BNG.

In this embodiment of the present disclosure, when a useraccesses/disconnects from the active BNG, or statistics of the usershould be updated, the active BNG saves the user information of theactive BNG into the local cache module of the active BNG Optionally, auser management module UM of the active BNG is configured to beresponsible for user access/disconnection or statistics management. Whena user accesses the active BNG, the UM saves user information of theuser into the local cache module of the active BNG.

Optionally, before step S301, the method further includes: obtaining, bythe active BNG and the at least one standby BNG of the active BNG,preset correlation information.

In this embodiment of the present disclosure, before a service isstarted, the preset correlation information may be pre-configured forthe active BNG and the standby BNG The preset correlation informationincludes: an active-standby relationship between the active BNG and theat least one standby BNG, and priorities of the active BNG and the atleast one standby BNG Optionally, an active-standby relationship betweenmultiple BNGs in a same hot standby group is determined based onpriorities, and a BNG with a highest priority (the active BNG) backs upuser information to a BNG with a second-highest priority (the firststandby BNG). When the active BNG becomes faulty, the first standby BNGstarts restoration of the user information of the active BNG Optionally,a BNG with a high priority periodically sends heartbeat information to aBNG with a low priority, so that the BNG with a low priority detects, inreal time, whether the BNG with a high priority becomes faulty (if noheart information of the BNG with a high priority is received within apreset time period, it may be learned that the BNG with a high prioritybecomes faulty). Optionally, when there are multiple BNGs with asecond-highest priority, a load balancing relationship between themultiple BNGs with a second-highest priority (the first standby BNG anda second standby BNG) may be specified. That is, when the BNG with ahighest priority (the active BNG) becomes faulty, the multiple BNGs witha second-highest priority are separately responsible for restoring whichusers of the BNG with a highest priority, so as to ensure responseconsistency of the BNGs with a second-highest priority (for example, thefirst standby BNG is configured to be responsible for restoring firstuser information corresponding to a user who accesses by using a firstinterface of the active BNG, and the second standby BNG is configured tobe responsible for restoring second user information corresponding to auser who accesses by using a second interface of the active BNG) whenthe BNG with a highest priority becomes faulty.

In this embodiment of the present disclosure, as shown in FIG. 3B, thehot standby system consists of a BNG 1, a BNG 2, and a BNG 3. Each BNGincludes a user management module UM, a local cache module, and a remotecache module. The BNGs share a same external database. The hot standbysystem includes three hot standby groups. As shown in Table 1 (Table 1is pre-planned correlation information 1), the BNG 1 and the BNG 2constitute a hot standby group 1; the BNG 1, the BNG 2, and the BNG 3constitute a hot standby group 2; and the BNG 1, the BNG 2, and the BNG3 constitute a hot standby group 3.

TABLE 1 Pre-planned correlation information 1 Sharing Method Used WhenMember in a Standby Group Standby Hot BNG Devices Standby Instance Havea Same Group Interface Number Priority Status Priority Hot Interface 1BNG 1 100 Active / standby and interface BNG 2 50 Standby / group 1 2 ofa BNG 1 Hot Interface 1 BNG 1 50 Standby 1 / standby and interface BNG 2100 Active / group 2 2 of a BNG 3 20 Standby 2 / BNG 2 Hot Interface 1BNG 3 200 Active / standby and interface BNG 1 100 Standby 1 User whogroup 3 2 of a accesses by BNG 3 using the interface 1 BNG 2 100 Standby1 User who accesses by using the interface 2

According to the description in Table 1, the following may be learned:(1) The BNG 2 (that is, a first standby BNG) in the hot standby group 1provides protection and restoration of user information for the BNG 1(an active BNG). That is, user information of all users who access theBNG 1 by using the interface 1 and the interface 2 of the BNG 1 shouldbe saved into the BNG 2. In addition, the BNG 2 detects a working statusof the BNG 1, and when the BNG 1 becomes faulty, the BNG 2 restores theuser information of the BNG 1. (2) The BNG 3 and the BNG 1 in the hotstandby group 2 provide protection and restoration of user informationfor the BNG 2. Because a priority of the BNG 1 is higher than that ofthe BNG 3, that is, the BNG 1 is a first standby BNG, when the BNG 2becomes faulty, the BNG 1 first restores the user information of the BNG2. Optionally, if the BNG 1 does not respond within a preset time (thatis, the BNG 1 may also become faulty), in this case, the BNG 3 starts torestore the user information of the BNG 2. (3) Two standby BNGs with asame priority (that is, a first standby BNG and a second standby BNG)are configured for the BNG 3 (an active BNG) in the hot standby group 3.In this case, a load balancing relationship between the first standbyBNG and the second standby BNG further should be defined, that is, howthe first standby BNG and the second standby BNG share responsibilityfor restoring users of the active BNG when the active BNG becomesfaulty. Optionally, division of the load balancing relationship may bebased on an interface used by a user to access the active device, orbased on a MAC address, or the like. This is not limited in thisembodiment of the present disclosure. For example, in an example shownin Table 1, for the BNG 3 in the hot standby group 3, the standby BNGsare balanced, based on different interfaces used by users to access theactive BNG, to be responsible for restoring users of the active BNG Userinformation of the BNG 3 is separately backed up to the BNG 1 and theBNG 2 based on an interface used by a user to access the active BNG Forexample, the load balancing relationship between the first standby BNGand the second standby BNG (that is, a load balancing relationshipbetween the BNG 1 and the BNG 2) is used to indicate that the BNG 1 isconfigured to be responsible for restoring first user informationcorresponding to a user who accesses by using the interface 1 of the BNG3, and the BNG 2 is configured to be responsible for restoring seconduser information corresponding to a user who accesses by using theinterface 2 of the BNG 3. Optionally, to ensure workload balancingbetween BNGs in a hot standby system (that is, the active-standby BNGsmay work at the same time), the hot standby system is divided intomultiple hot standby groups, and active-standby functions in themultiple hot standby groups are distributed to different BNGs by settingpriorities of BNGs in different hot standby groups, so that the BNGs maywork at the same time to improve utilization. For example, the activeBNGs in the three pre-planned hot standby groups in Table 1 arerespectively distributed to the BNG 1, the BNG 2, and the BNG 3, so asto improve utilization of the BNGs.

In this embodiment of the present disclosure, when a user accesses theBNG 3, UM in the BNG 3 saves user information of the user into the localcache module of the active BNG.

S302. The active BNG saves the user information into an externaldatabase shared with the at least one standby BNG, and sends the userinformation to a remote cache module of the at least one standby BNGbased on preset correlation information.

In this embodiment of the present disclosure, optionally, by checking anaddress of the configured external database and invoking an externaldatabase interface function, the local cache module of the active BNGsaves the user information into the external database shared with the atleast one standby BNG Further, the local cache module of the active BNGsends the user information to the remote cache module of the at leastone standby BNG based on the preset correlation information, forexample, sends the user information to a remote cache module of thefirst standby BNG with a highest priority in the at least one standbyBNG Alternatively, if the standby BNG with a highest priority in the atleast one standby BNG includes the first standby BNG and the secondstandby BNG, the active BNG sends the first user information in the userinformation to a remote cache module of the first standby BNG, and sendsthe second user information in the user information to a remote cachemodule of the second standby BNG based on the preset correlationinformation (including at least the load balancing relationship betweenthe first standby BNG and the second standby BNG). For example, the BNG3 determines, based on the load balancing relationship between the firststandby BNG and the second standby BNG (that is, the load balancingrelationship between the BNG 1 and the BNG 2), that the first userinformation corresponding to a user who accesses by using the interface1 of the BNG 3 should be backed up to a remote cache module of the BNG 1(the first standby BNG), and starts a data write operation tosynchronously send the first user information to the remote cache moduleof the BNG 1. Similarly, the BNG 3 determines, based on the loadbalancing relationship between the first standby BNG and the secondstandby BNG (that is, the load balancing relationship between the BNG 1and the BNG 2), that the second user information corresponding to a userwho accesses by using the interface 2 of the BNG 3 should be backed upto a remote cache module of the BNG 2 (the second standby BNG), andstarts a data write operation to synchronously send the second userinformation to the remote cache module of the BNG 2.

S303. The first standby BNG receives the user information sent by theactive BNG, and saves the user information into a remote cache module ofthe first standby BNG.

In this embodiment of the present disclosure, the first standby BNG witha highest priority in the at least one standby BNG receives the userinformation sent by the active BNG, and saves the user information intothe remote cache module of the first standby BNG Further, the remotecache module of the first standby BNG establishes an index based onidentity information of the active BNG When the active BNG becomesfaulty, the first standby BNG can read, in one time based on the index,all the user information stored in the remote cache module of the firststandby device BNG by the active BNG, so as to reduce a restorationtime. For example, the BNG 1 receives the first user information sent bythe BNG 3, and saves the first user information into the remote cachemodule of the BNG 1.

In this embodiment of the present disclosure, it is assumed that 200users access the BNG 3, 80 users access by using the interface 1 (thatis, 80 users access by using the interface 1 of the BNG 3), and 120users access by using the interface 2 (that is, 120 users access byusing the interface 2 of the BNG 3). In this case, quantities of userswhose information is stored in the BNGs in the hot standby group areshown in Table 2 (Table 2 is standby distribution of 200 users on theBNG 3).

TABLE 2 Standby distribution of 200 users on a BNG 3 Database BNG 1 BNG2 BNG 3 200 online No online user No online user 200 online users usersLocal Remote Local Remote Local Remote cache cache cache cache cachecache module module module module module module 0 80 0 120 200 0

S304. When detecting that the active BNG becomes faulty, the firststandby BNG directly obtains the user information from the remote cachemodule and restores the user information.

In this embodiment of the present disclosure, the first standby BNGkeeps detecting whether the active BNG becomes faulty. When detectingthat the active BNG becomes faulty, the first standby BNG directlyobtains the user information from the remote cache module of the firststandby BNG and restores the user information. Optionally, when thefirst standby BNG detects that the active BNG becomes faulty, a UMmodule of the first standby BNG reads the user information from theremote cache module of the first standby BNG, and restores, in the UMmodule, access of a user corresponding to the user information.Optionally, if the user information stored in the remote cache module ofthe first standby BNG is lost, the first standby BNG reads the userinformation from the external database, and restores the access of theuser.

For example, the BNG 1 and the BNG 2 detect a working status of the BNG3. Once the BNG 1 and the BNG 2 detect that the BNG 3 becomes faulty, UMmodules of the BNG 1 and the BNG 2 start a user restoration procedurefor the BNG 3. The UM module of the BNG 1 obtains, from the remote cachemodule of the BNG 1, the first user information corresponding to a userwho accesses by using the interface 1 of the BNG 3, and adds the firstuser information to a forwarding table, so as to implement restorationof the first user information. Correspondingly, the UM module of the BNG2 obtains, from the remote cache module of the BNG 2, the second userinformation corresponding to a user who accesses by using the interface2 of the BNG 3, and adds the second user information to a forwardingtable, so as to implement restoration of the second user information. Itmay be learned that after the BNG 3 becomes faulty, users of the BNG 3are taken over by the BNG 1 and the BNG 2, thereby implementing quickrestoration for a faulty BNG Distribution of online users after therestoration is shown in Table 3 (Table 3 is quantities of users whoaccess the BNG 1 and the BNG 2 after a fault occurs).

TABLE 3 Quantities of users who access a BNG 1 and a BNG 2 after a faultoccurs Database Storage BNG 1 BNG 2 BNG 3 200 80 120 Faulty

In conclusion, in this embodiment of the present disclosure, a multi-BNGhot standby function may be implemented, and user information of afaulty BNG may be quickly restored, thereby improving restorationefficiency. Further, a hot standby system in this embodiment of thepresent disclosure is generally divided into multiple hot standbygroups. A many-to-many standby relationship between multiple BNGs in thehot standby system may be divided into multiple pieces of simpleone-to-one “active-standby” correlation information (that is, themultiple BNGs are grouped into multiple independent hot standby groups,and simple one-to-one “active-standby” correlation information exists ineach hot standby group), so that a standby operation between themultiple BNGs in the hot standby system is greatly simplified. Further,active BNGs in different hot standby groups are respectively distributedto different BNGs, so that BNGs may work at the same time to improveutilization.

FIG. 4A is a schematic flowchart of Embodiment 4 of a hot standby methodaccording to the present disclosure. FIG. 4B is a schematic structuraldiagram of Embodiment 2 of a hot standby system according to the presentdisclosure. The method in this embodiment is applied to a hot standbysystem. The hot standby system includes at least one multi-servicecontrol module hot standby group of a virtual BNG, and the multi-servicecontrol module hot standby group of the virtual BNG includes: an activeservice control module of the virtual BNG and at least one standbyservice control module corresponding to the active service controlmodule. The first standby service control module is a standby servicecontrol module with a highest priority in the at least one standbyservice control module of the virtual BNG As shown in FIG. 4A, themethod in this embodiment may include the following steps.

S401. The active service control module saves user information of theactive service control module into a local cache module of the activeservice control module.

In this embodiment of the present disclosure, when a useraccesses/disconnects from the active service control module, orstatistics of the user should be updated, the active service controlmodule saves the user information of the active service control moduleinto the local cache module of the active service control module.Optionally, a user management module UM of the active service controlmodule is configured to be responsible for user access/disconnection orstatistics management. When a user accesses the active service controlmodule, the UM saves user information of the user into the local cachemodule of the active service control module.

Optionally, before step S401, the method further includes: obtaining, bythe active service control module and the at least standby servicecontrol module of the active service control module, preset correlationinformation.

In this embodiment of the present disclosure, before a service isstarted, the preset correlation information may be pre-configured forthe active service control module and the standby service controlmodule. The preset correlation information includes: an active-standbyrelationship between the active service control module and the at leastone standby service control module, and priorities of the active servicecontrol module and the at least one standby service control module.Optionally, an active-standby relationship between multiple servicecontrol modules in a same hot standby group is determined based onpriorities, and a service control module with a highest priority (theactive service control module) backs up user information to a servicecontrol module with a second-highest priority (the first standby servicecontrol module). When the active service control module becomes faulty,the first standby service control module starts restoration of the userinformation of the active service control module. Optionally, a servicecontrol module with a high priority periodically sends heartbeatinformation to a service control module with a low priority, so that theservice control module with a low priority detects, in real time,whether the service control module with a high priority becomes faulty(if no heart information of the service control module with a highpriority is received within a preset time period, it may be learned thatthe service control module with a high priority becomes faulty).Optionally, when there are multiple service control modules with asecond-highest priority, a load balancing relationship between themultiple service control modules with a second-highest priority (thefirst standby service control module and a second standby servicecontrol module) may be specified. That is, when the service controlmodule with a highest priority (the active service control module)becomes faulty, the multiple service control modules with asecond-highest priority are separately responsible for restoring whichusers of the service control module with a highest priority, so as toensure response consistency of the service control modules with asecond-highest priority (for example, the first standby service controlmodule is configured to be responsible for restoring first userinformation corresponding to a user who accesses by using a firstinterface of the active service control module, and the second standbyservice control module is configured to be responsible for restoringsecond user information corresponding to a user who accesses by using asecond interface of the active service control module) when the servicecontrol module with a highest priority becomes faulty.

In this embodiment of the present disclosure, as shown in FIG. 4B, thehot standby system includes a service control module 1, a servicecontrol module 2, a service control module 3, a service forwardingmodule 1, a service forwarding module 2, a service forwarding module 3,and a service forwarding module 4. Each service control module includesa user management module UM, a local cache module, and a remote cachemodule. The service control modules share a same external database. Thehot standby system includes three hot standby groups. As shown in Table4 (Table 4 is pre-planned correlation information 2), the servicecontrol module 1 and the service control module 2 constitute a hotstandby group 1; the service control module 1, the service controlmodule 2, and the service control module 3 constitute a hot standbygroup 2; the service control module 1, the service control module 2, andthe service control module 3 constitute a hot standby group 3.

TABLE 4 Pre-planned correlation information 2 Sharing Method Member in aStandby Group Used When Service Standby Control Devices Hot Module Havea Standby Instance Same Group Interface Number Priority Status PriorityHot Interface 1 Service 100 Active / standby and interface control group1 2 of a module 1 service control Service 50 Standby / module 1 controlmodule 2 Hot Interface 1 Service 50 Standby 1 / standby and interfacecontrol group 2 2 of a module 1 service control Service 100 Active /module control module 2 Service 20 Standby 2 / control module 3 HotInterface 1 Service 200 Active / standby and interface control group 3 2of a module 3 service control Service 100 Standby 1 User who modulecontrol accesses by module 1 using the interface 1 Service 100 Standby 1User who control accesses by module 2 using the interface 2

According to the description in Table 4, the following may be learned:(1) The service control module 2 (that is, a first standby servicecontrol module) in the hot standby group 1 provides protection andrestoration of user information for the service control module 1 (anactive service control module). That is, user information of all userswho access the service control module 1 by using the interface 1 and theinterface 2 of the service control module 1 should be saved into theservice control module 2. In addition, the service control module 2detects a working status of the service control module 1, and when theservice control module 1 becomes faulty, the service control module 2restores the user information of the service control module 1. (2) Theservice control module 3 and the service control module 1 in the hotstandby group 2 provide protection and restoration of user informationfor the service control module 2. Because a priority of the servicecontrol module 1 is higher than that of the service control module 3,that is, the service control module 1 is a first standby service controlmodule, when the service control module 2 becomes faulty, the servicecontrol module 1 first restores the user information of the servicecontrol module 2. Optionally, if the service control module 1 does notrespond within a preset time (that is, the service control module 1 mayalso become faulty), in this case, the service control module 3 startsto restore the user information of the service control module 2. (3) Twostandby service control modules with a same priority (that is, a firststandby service control module and a second standby service controlmodule) are configured for the service control module 3 (an activeservice control module) in the hot standby group 3. In this case, a loadbalancing relationship between the first standby service control moduleand the second standby service control module further should be defined,that is, how the first standby service control module and the secondstandby service control module share responsibility for restoring usersof the active service control module when the active service controlmodule becomes faulty. Optionally, division of the load balancingrelationship may be based on an interface used by a user to access theactive service control module, or based on a MAC address, or the like.This is not limited in this embodiment of the present disclosure. Forexample, in an example shown in Table 1, for the service control module3 in the hot standby group 3, the standby service control modules arebalanced, based on different interfaces used by users to access theactive service control module, to be responsible for restoring users ofthe active service control module. User information of the servicecontrol module 3 is separately backed up to the service control module 1and the service control module 2 based on an interface used by a user toaccess the active service control module. For example, the loadbalancing relationship between the first standby service control moduleand the second standby service control module (that is, a load balancingrelationship between the service control module 1 and the servicecontrol module 2) is used to indicate that the service control module 1is configured to be responsible for restoring first user informationcorresponding to a user who accesses by using the interface 1 of theservice control module 3, and the service control module 2 is configuredto be responsible for restoring second user information corresponding toa user who accesses by using the interface 2 of the service controlmodule 3. Optionally, to ensure workload balancing between servicecontrol modules in a hot standby system (that is, the active-standbyservice control modules may work at the same time), the hot standbysystem is divided into multiple hot standby groups, and active-standbyfunctions in the multiple hot standby groups are distributed todifferent service control modules by setting priorities of servicecontrol modules in different hot standby groups, so that the servicecontrol modules may work at the same time to improve utilization. Forexample, the active service control modules in the three pre-planned hotstandby groups in Table 1 are respectively distributed to the servicecontrol module 1, the service control module 2, and the service controlmodule 3, so as to improve utilization of the service control modules.

In this embodiment of the present disclosure, when a user accesses theservice control module 3, UM in the service control module 3 saves userinformation of the user into the local cache module of the activeservice control module.

S402. The active service control module saves the user information intoan external database shared with the at least one standby servicecontrol module, and sends the user information to a remote cache moduleof the at least one standby service control module based on presetcorrelation information.

In this embodiment of the present disclosure, optionally, by checking anaddress of the configured external database and invoking an externaldatabase interface function, the local cache module of the activeservice control module saves the user information into the externaldatabase shared with the at least one standby service control module.Further, the local cache module of the active service control modulesends the user information to the remote cache module of the at leastone standby service control module based on the preset correlationinformation, for example, sends the user information to a remote cachemodule of the first standby service control module with a highestpriority in the at least one standby service control module.Alternatively, if the standby service control module with a highestpriority in the at least one standby service control module includes thefirst standby service control module and the second standby servicecontrol module, the active service control module sends the first userinformation in the user information to a remote cache module of thefirst standby service control module, and sends the second userinformation in the user information to a remote cache module of thesecond standby service control module based on the preset correlationinformation (including at least the load balancing relationship betweenthe first standby service control module and the second standby servicecontrol module). For example, the service control module 3 determines,based on the load balancing relationship between the first standbyservice control module and the second standby service control module(that is, the load balancing relationship between the service controlmodule 1 and the service control module 2), that the first userinformation corresponding to a user who accesses by using the interface1 of the service control module 3 should be backed up to a remote cachemodule of the service control module 1 (the first standby servicecontrol module), and starts a data write operation to synchronously sendthe first user information to the remote cache module of the servicecontrol module 1. Similarly, the service control module 3 determines,based on the load balancing relationship between the first standbyservice control module and the second standby service control module(that is, the load balancing relationship between the service controlmodule 1 and the service control module 2), that the second userinformation corresponding to a user who accesses by using the interface2 of the service control module 3 should be backed up to a remote cachemodule of the service control module 2 (the second standby servicecontrol module), and starts a data write operation to synchronously sendthe second user information to the remote cache module of the servicecontrol module 2.

S403. The first standby service control module receives the userinformation sent by the active service control module, and saves theuser information into a remote cache module of the first standby servicecontrol module.

In this embodiment of the present disclosure, the first standby servicecontrol module with a highest priority in the at least one standbyservice control module receives the user information sent by the activeservice control module, and saves the user information into the remotecache module of the first standby service control module. Further, theremote cache module of the first standby service control moduleestablishes an index based on identity information of the active servicecontrol module. When the active service control module becomes faulty,the first standby service control module can read, in one time based onthe index, all the user information stored in the remote cache module ofthe first standby device service control module by the active servicecontrol module, so as to reduce a restoration time. For example, theservice control module 1 receives the first user information sent by theservice control module 3, and saves the first user information into theremote cache module of the service control module 1.

In this embodiment of the present disclosure, it is assumed that 200users access the service control module 3, 80 users access by using theinterface 1 (that is, 80 users access by using the interface 1 of theservice control module 3), and 120 users access by using the interface 2(that is, 120 users access by using the interface 2 of the servicecontrol module 3). In this case, quantities of users whose informationis stored in the service control modules in the hot standby group areshown in Table 5 (Table 5 is standby distribution of 200 users on theservice control module 3).

TABLE 5 Standby distribution of 200 users on a service control module 3Service control Service control Service control Database module 1 module2 module 3 200 online No online user No online user 200 online usersusers Local Remote Local Remote Local cache Remote cache cache cachecache module cache module module module module module 0 80 0 120 200 0

S404. When detecting that the active service control module becomesfaulty, the first standby service control module directly obtains theuser information from the remote cache module and restores the userinformation.

In this embodiment of the present disclosure, the first standby servicecontrol module keeps detecting whether the active service control modulebecomes faulty. When detecting that the active service control modulebecomes faulty, the first standby service control module directlyobtains the user information from the remote cache module of the firststandby service control module and restores the user information.Optionally, when the first standby service control module detects thatthe active service control module becomes faulty, a UM module of thefirst standby service control module reads the user information from theremote cache module of the first standby service control module, andrestores, in the UM module, access of a user corresponding to the userinformation. Optionally, if the user information stored in the remotecache module of the first standby service control module is lost, thefirst standby service control module reads the user information from theexternal database, and restores the access of the user.

For example, the service control module 1 and the service control module2 detect a working status of the service control module 3. Once theservice control module 1 and the service control module 2 detect thatthe service control module 3 becomes faulty, UM modules of the servicecontrol module 1 and the service control module 2 start a userrestoration procedure for the service control module 3. The UM module ofthe service control module 1 obtains, from the remote cache module ofthe service control module 1, the first user information correspondingto a user who accesses by using the interface 1 of the service controlmodule 3, so as to implement restoration of the first user information.Correspondingly, the UM module of the service control module 2 obtains,from the remote cache module of the service control module 2, the seconduser information corresponding to a user who accesses by using theinterface 2 of the service control module 3, so as to implementrestoration of the second user information. It may be learned that afterthe service control module 3 becomes faulty, users of the servicecontrol module 3 are taken over by the service control module 1 and theservice control module 2, thereby implementing quick restoration for afaulty service control module. Distribution of online users after therestoration is shown in Table 6 (Table 6 is quantities of users whoaccess the service control module 1 and the service control module 2after a fault occurs).

TABLE 6 Quantities of users who access a service control module 1 and aservice control module 2 after a fault occurs Database Service controlService control Service control Storage module 1 module 2 module 3 20080 120 Faulty

Optionally, after step S404, the method further includes: sending, bythe first standby service control module, a notification instruction toa service forwarding module of the virtual BNG, where the notificationinstruction is used to instruct the service forwarding module to send auser management message of a user corresponding to the user informationto the first standby service control module.

In conclusion, in this embodiment of the present disclosure, amulti-service control module hot standby function of a virtual BNG maybe implemented, and user information of a faulty service control modulemay be quickly restored, thereby improving restoration efficiency.Further, a hot standby system in this embodiment of the presentdisclosure is generally divided into multiple hot standby groups.Many-to-many correlation information between multiple service controlmodules in the hot standby system may be divided into multiple pieces ofsimple one-to-one “active-standby” correlation information (that is, themultiple service control modules are grouped into multiple independenthot standby groups, and simple one-to-one “active-standby” correlationinformation exists in each hot standby group, so that a standbyoperation between the multiple service control modules in the hotstandby system is greatly simplified. Further, active service controlmodules in different hot standby groups are respectively distributed todifferent service control modules, so that service control modules maywork at the same time to improve utilization.

FIG. 5 is a schematic structural diagram of Embodiment 1 of an activedevice according to the present disclosure. As shown in FIG. 5, theactive device 50 provided in this embodiment belongs to a hot standbysystem. The hot standby system includes at least one hot standby group,and the hot standby group includes: the active device 50 and at leastone standby device corresponding to the active device 50. The activedevice 50 includes a first storage module 501 and a first sending module502.

The first storage module 501 is configured to save first userinformation of the active device into a local cache module of the activedevice, where the local cache module of the active device is configuredto store user information of the active device.

The first sending module 502 is configured to send the first userinformation to a remote cache module of a first standby device based onpreset correlation information, so that when detecting that the activedevice becomes faulty, the first standby device obtains the first userinformation from the remote cache module of the first standby device andrestores the first user information, where the first standby device is adevice in the at least one standby device, and the remote cache moduleof the first standby device is configured to store the user informationof the active device.

The preset correlation information includes: an active-standbyrelationship between the active device and the first standby device anda first priority of the first standby device, where the first priorityindicates a priority level of restoring the user information of theactive device by the first standby device.

Optionally, the hot standby group is a multi-host hot standby group; and

correspondingly, the active device 50 is an active broadband networkgateway BNG, and the first standby device is a first standby BNG; or

the hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device 50 is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

Optionally, the active device further includes:

a second storage module, configured to save second user information ofthe active device into the local cache module of the active device; and

a second sending module, configured to send the second user informationof the active device to a remote cache module of a second standby devicebased on the preset correlation information, so that when detecting thatthe active device becomes faulty, the second standby device obtains thesecond user information from the remote cache module of the secondstandby device and restores the second user information, where thesecond standby device is a device in the at least one standby device,and the remote cache module of the second standby device is configuredto store the user information of the active device.

The preset correlation information further includes: an active-standbyrelationship between the active device and the second standby device, asecond priority of the second standby device, and a load balancingrelationship between the first standby device and the second standbydevice, where the second priority indicates a priority level ofrestoring the user information of the active device by the secondstandby device; the first priority is the same as the second priority;and the load balancing relationship is used to indicate that when theactive device becomes faulty, the first standby device is configured tobe responsible for restoring the first user information, and the secondstandby device is configured to be responsible for restoring the seconduser information.

Optionally, the first user information is information corresponding to auser who accesses by using a first interface of the active device, andthe second user information is information corresponding to a user whoaccesses by using a second interface of the active device, where thefirst interface is different from the second interface.

Optionally, the active device further includes:

a third sending module, configured to send the first user information toa remote cache module of a third standby device based on the presetcorrelation information, where the third standby device is a device inthe at least one standby device.

The preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

Optionally, the active device further includes:

a fourth sending module, configured to send the first user informationand the second user information to a remote cache module of a thirdstandby device based on the preset correlation information, where thethird standby device is a device in the at least one standby device.

The preset correlation information further includes: an active-standbyrelationship between the active device and the third standby device anda third priority of the third standby device, where the third priorityindicates a priority level of restoring the user information of theactive device by the third standby device, and the third priority islower than the first priority.

Optionally, the active device further includes:

a third storage module, configured to save the first user informationinto an external database shared with the at least one standby device.

Optionally, the active device further includes:

a fourth storage module, configured to save the first user informationand the second user information into an external database shared withthe at least one standby device.

The active device in this embodiment may be configured to execute thetechnical solutions in the hot standby method embodiment 1, embodiment3, and embodiment 4 of the present disclosure. An implementationprinciple and a technical effect of the active device are similar tothose in the embodiments, and details are not described herein again.

FIG. 6 is a schematic structural diagram of Embodiment 2 of an activedevice according to the present disclosure. As shown in FIG. 6, theactive device 60 provided in this embodiment belongs to a hot standbysystem. The hot standby system includes at least one hot standby group,and the hot standby group includes: the active device 60 and at leastone standby device corresponding to the active device 60. The activedevice 60 may include a processor 601 and a memory 602. The activedevice 60 may further include a data interface unit 603. The datainterface unit 603 may be connected to the processor 601. The datainterface unit 603 is configured to receive/send user information. Thememory 602 is configured to store an execution instruction. When theactive device 60 runs, the processor 601 and the memory 602 communicatewith each other. The processor 601 invokes the execution instruction inthe memory 602, so as to execute operations in the hot standby methodembodiment 1, embodiment 3, and embodiment 4 of the present disclosure.

The active device in this embodiment may be configured to execute thetechnical solutions in the hot standby method embodiment 1, embodiment3, and embodiment 4 of the present disclosure. An implementationprinciple and a technical effect of the active device are similar tothose in the embodiments, and details are not described herein again.

FIG. 7 is a schematic structural diagram of Embodiment 1 of a firststandby device according to the present disclosure. As shown in FIG. 7,the first standby device 70 provided in this embodiment belongs to a hotstandby system. The hot standby system includes at least one hot standbygroup, and the hot standby group includes: an active device and at leastone standby device corresponding to the active device. The at least onestandby device includes the first standby device with a first priority.The first priority indicates a priority level of restoring userinformation of the active device by the first standby device. The firststandby device 70 includes a storage module 701 and a restoration module702.

The storage module 701 is configured to: receive first user informationsent by the active device, and save the first user information into aremote cache module of the first standby device, where the remote cachemodule of the first standby device is configured to store the userinformation of the active device.

The restoration module 702 is configured to: when detecting that theactive device becomes faulty, obtain the first user information from theremote cache module and restore the first user information.

Optionally, the hot standby group is a multi-host hot standby group; and

correspondingly, the active device is an active broadband networkgateway BNG, and the first standby device is a first standby BNG; or

the hot standby group is a multi-service control module hot standbygroup of a virtual BNG; and correspondingly, the active device is anactive service control module of the virtual BNG, and the first standbydevice is a first standby service control module of the virtual BNG.

Optionally, the first standby device 70 further includes:

an establishment module, configured to establish an index based onidentity information of the active device; and

correspondingly, the restoration module is configured to: directlyobtain the first user information from the remote cache module based onthe index and restore the first user information.

Optionally, when the hot standby group is the multi-service controlmodule hot standby group of the virtual BNG, correspondingly, when theactive device is the active service control module of the virtual BNG,and the first standby device is the first standby service control moduleof the virtual BNG, the first standby device 70 further includes:

a notification module, configured to send a notification instruction toa service forwarding module, where the notification instruction is usedto instruct the service forwarding module to send a user managementmessage of a user corresponding to the first user information to thefirst standby service control module.

The first standby device in this embodiment may be configured to executethe technical solutions in the hot standby method embodiment 2,embodiment 3, and embodiment 4 of the present disclosure. Animplementation principle and a technical effect of the first standbydevice are similar to those in the embodiments, and details are notdescribed herein again.

FIG. 8 is a schematic structural diagram of Embodiment 2 of a firststandby device according to the present disclosure. As shown in FIG. 8,the first standby device 80 provided in this embodiment belongs to a hotstandby system. The hot standby system includes at least one hot standbygroup, and the hot standby group includes: an active device and at leastone standby device corresponding to the active device. The at least onestandby device includes the first standby device with a first priority.The first priority indicates a priority level of restoring userinformation of the active device by the first standby device. The firststandby device 80 may include a processor 801 and a memory 802. Thefirst standby device 80 may further include a data interface unit 803.The data interface unit 803 may be connected to the processor 801. Thedata interface unit 803 is configured to receive/send user information.The memory 802 is configured to store an execution instruction. When thefirst standby device 80 runs, the processor 801 and the memory 802communicate with each other. The processor 801 invokes the executioninstruction in the memory 802, so as to execute operations in the hotstandby method embodiment 2, embodiment 3, and embodiment 4 of thepresent disclosure.

The first standby device in this embodiment may be configured to executethe technical solutions in the hot standby method embodiment 2,embodiment 3, and embodiment 4. An implementation principle and atechnical effect of the first standby device are similar to those in theembodiments, and details are not described herein again.

An embodiment of the present disclosure provides a hot standby system.The hot standby system includes at least one hot standby group, and thehot standby group includes: an active device and at least one standbydevice corresponding to the active device. The at least one standbydevice includes a first standby device. The active device may usestructures in Embodiment 1 and Embodiment 2 of an active device, and maycorrespondingly execute the technical solutions in the hot standbymethod embodiment 1, embodiment 3, and embodiment 4. An implementationprinciple and a technical effect of the active device are similar tothose in the embodiments, and details are not described herein again.The first standby device may use structures in Embodiment 1 andEmbodiment 2 of a first standby device, and may correspondingly executethe technical solutions in the hot standby method embodiment 2,embodiment 3, and embodiment 4. An implementation principle and atechnical effect of the first standby device are similar to those in theembodiments, and details are not described herein again.

Persons of ordinary skill in the art may understand that all or some ofthe steps of the method embodiments may be implemented by a programinstructing relevant hardware. The program may be stored in acomputer-readable storage medium. When the program runs, the steps ofthe method embodiments are performed. The foregoing storage mediumincludes: any medium that can store program code, such as a ROM, a RAM,a magnetic disk, or an optical disc.

Finally, it should be noted that the foregoing embodiments are merelyintended for describing the technical solutions of the presentdisclosure, but not for limiting the present disclosure. Although thepresent disclosure is described in detail with reference to theforegoing embodiments, persons of ordinary skill in the art shouldunderstand that they may still make modifications to the technicalsolutions described in the foregoing embodiments or make equivalentreplacements to some or all technical features thereof, withoutdeparting from the scope of the technical solutions of the embodimentsof the present disclosure.

What is claimed is:
 1. A network device, applied to a hot standby systemcomprising: an active device, and at least one standby devicecorresponding to the active device, wherein the at least one standbydevice comprises a first standby device and a second standby device,wherein the hot standby system comprises a load balancing relationshipbetween the first standby device and the second standby device, a firstactive-standby relationship between the active device and the firststandby device as to one or more first users, and a secondactive-standby relationship between the active device and the secondstandby device as to one or more second users, and wherein the networkdevice acts as the active device and comprises: a memory comprisinginstructions; and one or more processors in communication with thememory, wherein the one or more processors execute the instructions to:send first user information corresponding to the one or more first usersto the first standby device, wherein the first user information is usedby the first standby device to take over the one or more first userswhen the active device becomes faulty, and send second user informationcorresponding to the one or more second users to the second standbydevice, wherein the second user information is used by the secondstandby device to take over the one or more second users when the activedevice becomes faulty.
 2. The network device of claim 1, wherein theactive device comprises an active broadband network gateway (BNG),wherein the first standby device comprises a first standby BNG, andwherein the second standby device comprises a second standby BNG.
 3. Thenetwork device of claim 1, wherein the first user information comprisesat least one of following information: a user identity (ID), a MediaAccess Control (MAC) address of a user, an Internet Protocol (IP)address of the user, physical location information of the user, anaccess protocol attribute of the user, session information, or trafficstatistics.
 4. The network device of claim 1, wherein the load balancingrelationship is divided based on an interface through which a user ofthe active device to access the active device, the one or more firstusers access the active device through a first interface of the activedevice, and the one or more second users access the active devicethrough a second interface of the active device, and wherein the firstinterface is different from the second interface.
 5. The network deviceof claim 1, wherein the one or more processors further execute theinstructions to: send the first user information to a third standbydevice of the at least one standby device, wherein the hot standbysystem comprises: a third active-standby relationship between the activedevice and the third standby device as to the one or more first users,and a first priority of the first standby device and a third priority ofthe third standby device, wherein the first priority indicates apriority level of taking over the one or more first users of the activedevice by the first standby device, and the third priority indicates apriority level of taking over the one or more first users of the activedevice by the third standby device, and wherein the third priority islower than the first priority.
 6. The network device of claim 1, whereinthe one or more processors further execute the instructions to: send thefirst user information and the second user information to a thirdstandby device of the at least one standby device, wherein the hotstandby system further comprises: a third active-standby relationshipbetween the active device and the third standby device as to the one ormore first users and the one or more second users, a first priority ofthe first standby device, wherein the first priority indicates apriority level of taking over the one or more first users of the activedevice by the first standby device, a second priority of the secondstandby device, wherein the second priority indicates a priority levelof taking over the one or more second users of the active device by thesecond standby device, and a third priority of the third standby device,wherein the third priority indicates a priority level of taking over theone or more first users or the one or more second users of the activedevice by the third standby device, and wherein the third priority islower than the first priority and the second priority.
 7. The networkdevice of claim 1, wherein the one or more processors further executethe instructions to: save the first user information and the second userinformation of the active device into the memory of the active device,wherein the memory of the active device is configured to store userinformation of the active device.
 8. The network device of claim 7,wherein the one or more processors further execute the instructions to:save the first user information into an external database shared withthe at least one standby device.
 9. The network device of claim 7,wherein the one or more processors further execute the instructions to:save the first user information and the second user information into anexternal database shared with the at least one standby device.
 10. Thenetwork device of claim 1, wherein the one or more processors furtherexecute the instructions to: send third user information to a fourthstandby device of the at least one standby device, wherein the hotstandby system further comprises: a fourth active-standby relationshipbetween the active device and the fourth standby device as to one ormore third users, and wherein the third user information is used by thefourth standby device to take over the one or more third users when theactive device becomes faulty.
 11. The network device of claim 1, whereinthe hot standby system further comprises a third active-standbyrelationship between another active device and a third standby devicecorresponding to the another active device as to one or more thirdusers, wherein the network device further acts as the third standbydevice, the one or more processors further execute the instructions to:receive third user information corresponding to the one or more thirdusers sent by the another active device; when detecting that the anotheractive device becomes faulty, take over the one or more third usersaccording to the third user information.
 12. A network device, appliedto a hot standby system comprising: an active device, and at least onestandby device corresponding to the active device, wherein the at leastone standby device comprises a first standby device and a second standbydevice, wherein the hot standby system comprises a load balancingrelationship between the first standby device and the second standbydevice, a first active-standby relationship between the active deviceand the first standby device as to one or more first users, and a secondactive-standby relationship between the active device and the secondstandby device as to one or more second users, and wherein the networkdevice acts as the first standby device and comprises: a memorycomprising instructions; and one or more processors in communicatingwith the memory, wherein the one or more processors execute theinstructions to: receive first user information corresponding to the oneor more first users sent by the active device; and when detecting thatthe active device becomes faulty, take over the one or more first usersaccording to the first user information.
 13. The network device of claim12, wherein the active device comprises an active broadband networkgateway (BNG), wherein the first standby device comprises a firststandby BNG, and wherein the second standby device comprises a secondstandby BNG.
 14. The network device of claim 12, wherein the first userinformation comprises at least one of following information: a useridentity (ID), a Media Access Control (MAC) address of a user, anInternet Protocol (IP) address of the user, physical locationinformation of the user, an access protocol attribute of the user,session information, or traffic statistics.
 15. The network device ofclaim 12, wherein the load balancing relationship is divided based on aninterface through which a user of the active device to access the activedevice, the one or more first users access the active device through afirst interface of the active device, and the one or more second usersaccess the active device through a second interface of the activedevice, and wherein the first interface is different from the secondinterface.
 16. The network device of claim 12, wherein the hot standbysystem further comprises a third active-standby relationship betweenanother active device and a third standby device corresponding to theanother active device as to one or more third users, wherein the networkdevice further acts as the another active device, the one or moreprocessors further execute the instructions to: send third userinformation corresponding to the one or more third users to the thirdstandby device, wherein the third user information is used by the thirdstandby device to take over the one or more third users when the anotheractive device becomes faulty.
 17. A hot standby method comprising:sending, by an active device, first user information corresponding toone or more first users to a first standby device and second userinformation corresponding to one or more second users to a secondstandby device, wherein the active device belongs to a hot standbysystem comprising: the active device, and at least one standby devicecorresponding to the active device, wherein the at least one standbydevice comprises the first standby device and the second standby device,wherein the hot standby system comprises a load balancing relationshipbetween the first standby device and the second standby device, a firstactive-standby relationship between the active device and the firststandby device as to the one or more first users, and a secondactive-standby relationship between the active device and the secondstandby device as to the one or more second users; receiving, by thefirst standby device, the first user information; receiving, by thesecond standby device, the second user information; when detecting thatthe active device becomes faulty, taking over, by the first standbydevice, the one or more first users according to the first userinformation; and when detecting that the active device becomes faulty,taking over, by the second standby device, the one or more second usersaccording to the second user information.
 18. The method of claim 17,wherein the active device comprises an active broadband network gateway(BNG), wherein the first standby device comprises a first standby BNG,and wherein the second standby device comprises a second standby BNG.19. The method of claim 17, wherein the first user information comprisesat least one of following information: a user identity (ID), a MediaAccess Control (MAC) address of a user, an Internet Protocol (IP)address of a user, physical location information of a user, an accessprotocol attribute of a user, session information, or trafficstatistics.
 20. The method of claim 17, wherein the load balancingrelationship is divided based on an interface through which a user ofthe active device to access the active device, the one or more firstusers access the active device through a first interface of the activedevice, and the one or more second users access the active devicethrough a second interface of the active device, and wherein the firstinterface is different from the second interface.
 21. The method ofclaim 17, further comprising: sending, by the active device, the firstuser information to a third standby device of the at least one standbydevice, wherein the hot standby system further comprises: a thirdactive-standby relationship between the active device and the thirdstandby device as to the one or more first users, a first priority ofthe first standby device, wherein the first priority indicates apriority level of taking over the one or more first users of the activedevice by the first standby device, and a third priority of the thirdstandby device, wherein the third priority indicates a priority level oftaking over the one or more first users of the active device by thethird standby device, and wherein the third priority is lower than thefirst priority.
 22. The method of claim 17, further comprising: sending,by the active device, the first user information and the second userinformation to a third standby device of the at least one standbydevice, wherein hot standby system further comprises: a thirdactive-standby relationship between the active device and the thirdstandby device as to the one or more first users and the one or moresecond users, a first priority of the first standby device, wherein thefirst priority indicates a priority level of taking over the one or morefirst users of the active device by the first standby device, a secondpriority of the second standby device, the second priority indicates apriority level of taking over the one or more second users of the activedevice by the second standby device, and a third priority of the thirdstandby device, wherein the third priority indicates a priority level oftaking over the one or more first users or the one or more second usersof the active device by the third standby device, and wherein the thirdpriority is lower than the first priority and the second priority. 23.The method of claim 17, further comprising: saving, by the activedevice, the first user information and the second user information ofthe active device into the memory of the active device, wherein thememory of the active device is configured to store user information ofthe active device.
 24. The method of claim 23, further comprising:saving, by the active device, the first user information into anexternal database shared with the at least one standby device.
 25. Themethod of claim 23, further comprising: saving, by the active device,the first user information and the second user information into anexternal database shared with the at least one standby device.
 26. Themethod of claim 17, further comprising: sending, by the active device,third user information to a fourth standby device of the at least onestandby device, wherein the hot standby system further comprises: afourth active-standby relationship between the active device and thefourth standby device as to one or more third users, and wherein thethird user information is used by the fourth standby device to take overthe one or more third users when the active device becomes faulty. 27.The method of claim 17, wherein the hot standby system furthercomprises: a third active-standby relationship between another activedevice and a third standby device corresponding to the another activedevice as to one or more third users, wherein the first standby devicefurther acts as the another active device, the method further comprises:sending, by the another active, third user information corresponding tothe one or more third users to the third standby device; receiving, bythe third standby device, the third user information; when detectingthat the another active device becomes faulty, taking over, by the thirdstandby device, the one or more third users according to the third userinformation.
 28. The method of claim 27, wherein the second standbydevice further acts as the third standby device.
 29. The method of claim27, wherein the active device further acts as the third standby device.30. A hot standby system, comprising: an active device and at least onestandby device corresponding to the active device, wherein the at leastone standby device comprises a first standby device and an secondstandby device; wherein the active device is configured to: send firstuser information corresponding to one or more first users to the firststandby device, and send second user information corresponding to one ormore second users to the second standby device, wherein the hot standbysystem comprises a load balancing relationship between the first standbydevice and the second standby device, a first active-standbyrelationship between the active device and the first standby device asto the one or more first users, and a second active-standby relationshipbetween the active device and the second standby device as to the one ormore second users; wherein the first standby device is configured to:receive the first user information; when detecting that the activedevice becomes faulty, take over the one or more first users accordingto the first user information; wherein the second standby device isconfigured to: receive the second user information; when detecting thatthe active device becomes faulty, take over the one or more second usersaccording to the second user information.
 31. The hot standby system ofclaim 30, wherein the active device comprises an active broadbandnetwork gateway (BNG), wherein the first standby device comprises afirst standby BNG, and wherein the second standby device comprises asecond standby BNG.
 32. The hot standby system of claim 30, wherein thefirst user information comprises at least one of following information:a user identity (ID), a Media Access Control (MAC) address of a user, anInternet Protocol (IP) address of the user, physical locationinformation of the user, an access protocol attribute of the user,session information, or traffic statistics.
 33. The hot standby systemof claim 23, wherein the load balancing relationship is divided based onan interface through which a user of the active device to access theactive device, the one or more first users access the active devicethrough a first interface of the active device, and the one or moresecond users access the active device through a second interface of theactive device, and wherein the first interface is different from thesecond interface.
 34. The hot standby system of claim 30, wherein theactive device is further configured to: send the first user informationto a third standby device of the at least one standby device, whereinthe hot standby system further comprises: a third active-standbyrelationship between the active device and the third standby device asto the one or more first users, a first priority of the first standbydevice, wherein the first priority indicates a priority level of takingover the one or more first users of the active device by the firststandby device, and a third priority of the third standby device,wherein the third priority indicates a priority level of taking over theone or more first users of the active device by the third standbydevice, and wherein the third priority is lower than the first priority.35. The hot standby system of claim 30, wherein the active device isfurther configured to: send the first user information and the seconduser information to a third standby device of the at least one standbydevice, wherein hot standby system further comprises: a thirdactive-standby relationship between the active device and the thirdstandby device as to the one or more first users and the one or moresecond users, a first priority of the first standby device, wherein thefirst priority indicates a priority level of taking over the one or morefirst users of the active device by the first standby device, a secondpriority of the second standby device, the second priority indicates apriority level of taking over the one or more second users of the activedevice by the second standby device, and a third priority of the thirdstandby device, wherein the third priority indicates a priority level oftaking over the one or more first users or the one or more second usersof the active device by the third standby device, and wherein the thirdpriority is lower than the first priority and the second priority. 36.The hot standby system of claim 30, wherein the active device is furtherconfigured to: save the first user information and the second userinformation of the active device into the memory of the active device,wherein the memory of the active device is configured to store userinformation of the active device.
 37. The hot standby system of claim36, wherein the active device is further configured to: save the firstuser information into an external database shared with the at least onestandby device.
 38. The hot standby system of claim 36, wherein theactive device is further configured to: save the first user informationand the second user information into an external database shared withthe at least one standby device.
 39. The hot standby system of claim 30,wherein the active device is further configured to: send third userinformation to a fourth standby device of the at least one standbydevice, wherein the hot standby system comprises further comprises: afourth active-standby relationship between the active device and thefourth standby device as to one or more third users, and wherein thethird user information is used by the fourth standby device to take overthe one or more third users when the active device becomes faulty. 40.The hot standby system of claim 30, further comprising a thirdactive-standby relationship between another active device and a thirdstandby device corresponding to the another active device as to one ormore third users, wherein the first standby device further acts as theanother active device, wherein the another active device is furtherconfigured to: send third user information corresponding to the one ormore third users to the third standby device; wherein the third standbydevice is further configured to: receive the third user information;when detecting that the another active device becomes faulty, take overthe one or more third users according to the third user information. 41.The hot standby system of claim 40, wherein the second standby devicefurther acts as the third standby device.
 42. The hot standby system ofclaim 40, wherein the active device further acts as the third standbydevice.
 43. A non-transitory computer-readable medium havinginstructions stored therein, which when executed by a processor, causethe processor to: send first user information corresponding to one ormore first users to a first standby device and send second userinformation corresponding to one or more second users to a secondstandby device, wherein the hot standby system comprises: the activedevice, and at least one standby device corresponding to the activedevice, wherein the at least one standby device comprises the firststandby device and the second standby device, wherein the hot standbysystem comprises a load balancing relationship between the first standbydevice and the second standby device, a first active-standbyrelationship between the active device and the first standby device asto the one or more first users, and a second active-standby relationshipbetween the active device and the second standby device as to the one ormore second users; wherein the first user information is used by thefirst standby device to take over the one or more first users when theactive device becomes faulty, and wherein the second user information isused by the second standby device to take over the one or more secondusers when the active device becomes faulty.